<!-- PC端 -->
<div class="wrapper wrapper-content" ng-if="!vm.isMobile">
	<div class="container">
	    <div class="ibox-title">
	    	<div class="row">
	    		<div class="col-xs-9">
	    			<form name="searchForm" ng-submit="vm.search(vm.query)">
		    			<div class="input-group">
				            <input name="query" type="text" placeholder="输入你想查询的机构名称" class="input form-control" ng-model="vm.query">
				            <span class="input-group-btn">
				                <button type="submit" class="btn btn btn-primary"><i class="fa fa-search"></i>搜索</button>
				            </span>
				        </div>
			        </form>
	    		</div>
	    		<div class="col-xs-3">
	    			<div class="ibox-tools" id="grumble">
				        <a class="btn btn-primary" ui-sref="dashboard.company">创建机构</a>
				    </div>
	    		</div>
	    	</div>
		</div>
	    <div class="ibox-content margin-top-20">
			<div class="project-list xRightMatrix">
				<table class="table table-hover">
					<thead>
			            <tr>
			                <th class="text-center" width="10%">机构状态</th>
			                <th class="text-center" width="10%">机构名称</th>
			                <th class="text-center" width="10%">机构LOGO</th>
			                <th class="text-center" width="15%">机构简介</th>
			                <th class="text-center" width="35%">赛事列表</th>
			                <th class="text-center" width="20%">操作</th>
			            </tr>
			        </thead>
					<tbody>
						<tr ng-repeat="company in vm.companylist">
						    <td class="project-status" width="10%">
						        <span class="label label-primary" ng-if="company.status=='normal'">已认证</span>
						        <span class="label label-danger" ng-if="company.status=='verify'">未认证</span>
						    </td>
						    <td class="project-title" width="10%" ng-click="vm.list(company.status, company.company_id)">
						        <a>{{company.company_name}}</a>
						    </td>
						    <td class="project-title" width="10%">
						        <img imglazy alt="image" class="img-circle img-responsive company-logo" data-original="{{company.logo}}" image-404="images/logo_rz.png">
						    </td>
						    <td class="project-title" width="15%">
						        <span>{{company.city}}</span><br>
				                <span ng-if="company.race_scale">{{company.race_scale}}</span><br>
				                <span>
				                	<span ng-if="company.type=='organizer'">{{vm.company_types[0]['name']}}</span>
				                	<span ng-if="company.type=='undertake'">{{vm.company_types[1]['name']}}</span>
				                	<span ng-if="company.type=='facilitator'">{{vm.company_types[2]['name']}}</span>
				                	<span ng-if="company.type=='club'">{{vm.company_types[3]['name']}}</span>
		                		</span>
						    </td>
						    <td class="text-center" width="35%">
						    	<div id="{{company.qrcode_id}}"></div>
	                			<a ng-href="{{company.race_url}}" target="_blank">{{company.race_url}}</a>
						    </td>
						    <td class="text-center" width="20%">
						        <button class="btn btn-white btn-sm" ng-click="vm.list(company.status, company.company_id)"><i class="fa fa-angle-double-right"></i> 进入</button>
						        <button class="btn btn-white btn-sm" ui-sref="dashboard.companyview({company_id: company.company_id})"><i class="fa fa-folder"></i> 查看</button>
						        <button class="btn btn-white btn-sm" ui-sref="dashboard.companyedit({company_id: company.company_id})" ng-if="company.status == 'verify' ? true : false"><i class="fa fa-pencil"></i> 编辑</button>
						    </td>
						</tr>
						<tr class="odd" ng-show="vm.companylist.length==0">
							<td valign="top" colspan="6" class="dataTables_empty">暂无数据。</td>
						</tr>
					</tbody>
				</table>
			</div>
		</div>
	</div>
</div>

<!-- 移动端 -->
<div class="wrapper wrapper-content" ng-if="vm.isMobile">
	<ul class="row">
		<li class="col-xs-12 col-sm-6 col-md-4 col-lg-3 xRightMatrix" ng-repeat="company in vm.companylist" on-finish-render-filters>
			<div class="contact-box box-hover" ng-class="{'box-grey': company.status=='verify'}">
		        <a>
		            <div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
		                <div class="text-center">
		                    <img imglazy alt="image" class="img-circle img-responsive image" data-original="{{company.logo}}" image-404="images/logo_rz.png">
		                </div>
		            </div>
		            <div class="col-xs-8 col-sm-8 col-md-8 col-lg-8">
		                <h3><strong>{{company.company_name}}</strong></h3>
		                <span>{{company.city}}</span><br>
		                <span ng-if="company.race_scale">{{company.race_scale}}</span><br>
		                <span>
		                	<span ng-if="company.type=='organizer'">{{company_types[0]['name']}}</span>
		                	<span ng-if="company.type=='undertake'">{{company_types[1]['name']}}</span>
		                	<span ng-if="company.type=='facilitator'">{{company_types[2]['name']}}</span>
		                	<span ng-if="company.type=='club'">{{company_types[3]['name']}}</span>
		                </span>
		            </div>
		            <div class="clearfix"></div>
		        </a>
		        <div class="box-grey-btns text-center" ng-if="company.status=='verify'">
					<p>您的机构还未认证，快点联系小艾管理员帮您开通</p>
					<p>联系方式：irunner@landc-consulting.com</p>
		        </div>
		        <div class="btns text-center" ng-if="company.status=='normal'">
	        		<button typr="button" class="btn btn-primary" ui-sref="dashboard.list({company_id: company.company_id})">赛事列表</button>
	        		<button typr="button" class="btn btn-warning" ui-sref="dashboard.companyview({company_id: company.company_id})">查看</button>
	        		<button typr="button" class="btn btn-danger" ui-sref="dashboard.companyedit({company_id: company.company_id})">编辑</button>
	        	</div>
	        	<div class="verify normal" ng-if="company.status=='normal'">
	        		<span>已认证</span>
	        	</div>
	        	<div class="verify not" ng-if="company.status=='verify'">
	        		<span>未认证</span>
	        	</div>
		    </div>
		</li>
		<li class="col-xs-12 col-sm-6 col-md-4 col-lg-3 xRightMatrix">
			<div class="contact-box" id="grumble">
		        <a class="dashboard-create" ui-sref="dashboard.company">
		        </a>
		    </div>
		</li>
	</ul>
</div>

<div ng-include="footerHtml"></div>